/* 
 * File:   Solver.h
 * Author: stuart
 *
 * Created on June 14, 2012, 3:17 PM
 */

#ifndef SOLVER_H
#define	SOLVER_H

#include <map>

using namespace std;

#include "Configurable.h"
#include "Node.h"

class Solver : public Configurable {
    void apply_dimensions(Node* raiz, map<Node*, int>* mapa, CvMat* x, Orientation orientation);
    void calculate_bissections(CvMat* A, CvMat* B, Node* raiz, map<Node*, int>* mapa, Orientation orientacaoSolucao);
    void calculate_node(CvMat* A, CvMat* B, Node* no, Node* raiz, map<Node*, int>* mapa, Orientation orientacaoSolucao, bool oposto);
    void mapear(Node* no, map<Node*, int>* mapa);
    void modify(Node* root, double a);
    int aprox(double d);

public:
    void solve(Node* root);
    void solve(Node* root, Orientation orientation);
    void fix(Node* root);
};

#endif	/* SOLVER_H */

